package com.yinhai.activity;


import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

/**
 * UpdateActivity （版本更新）
 * 
 * @author Juyon
 */
public class AppSuggestActivity extends Activity {

	/*
	 * (non-Javadoc)
	 * 
	 * @see android.app.Activity#onCreate(android.os.Bundle)
	 */
	@SuppressLint("SetJavaScriptEnabled")
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.more_app_suggestion);

		findViewById(R.id.more_app1_tv).setOnClickListener(onClickListener);
		findViewById(R.id.more_app2_tv).setOnClickListener(onClickListener);
		findViewById(R.id.more_app3_tv).setOnClickListener(onClickListener);
		findViewById(R.id.more_app4_tv).setOnClickListener(onClickListener);
		findViewById(R.id.more_app5_tv).setOnClickListener(onClickListener);
		findViewById(R.id.more_app6_tv).setOnClickListener(onClickListener);
		findViewById(R.id.more_app7_tv).setOnClickListener(onClickListener);
		findViewById(R.id.more_app8_tv).setOnClickListener(onClickListener);
		findViewById(R.id.more_app9_tv).setOnClickListener(onClickListener);
		findViewById(R.id.more_app10_tv).setOnClickListener(onClickListener);
		findViewById(R.id.more_app11_tv).setOnClickListener(onClickListener);
		findViewById(R.id.more_app12_tv).setOnClickListener(onClickListener);
		findViewById(R.id.more_app13_tv).setOnClickListener(onClickListener);
		findViewById(R.id.more_app14_tv).setOnClickListener(onClickListener);
		findViewById(R.id.more_app15_tv).setOnClickListener(onClickListener);
		findViewById(R.id.more_app16_tv).setOnClickListener(onClickListener);

	}

	public void doBack(View view) {
		onBackPressed();
	}

	private OnClickListener onClickListener = new OnClickListener() {

		@Override
		public void onClick(View v) {
			String url = "";
			String title = ((TextView) v).getText().toString();
			switch (v.getId()) {
			case R.id.more_app1_tv:
				url = "http://wap.cq.10086.cn/app?service=page/Login&listener=initPage";
				break;
			case R.id.more_app2_tv:
				url = "http://a.10086.cn/pams2/s/s.do?c=172&j=l&p=72&gId=300002734449&src=90.640009.201200003";
				break;
			case R.id.more_app3_tv:
				url = "http://a.10086.cn";
				break;
			case R.id.more_app4_tv:
				url = "http://a.10086.cn/pams2/s/s.do?gId=100008870101377100000003620300000004151&c=172&j=l&lnpsk=%E6%89%8B%E6%9C%BA%E5%AF%BC%E8%88%AA&lnpsid=18cc7dca41894647b5bfb60a90633219&lnpspn=1&lnpsr=1&lnpst=0&lnpsgt=appSoftWare&p=72&src=5200000016";
				break;
			case R.id.more_app5_tv:
				url = "http://p.10086.cn";
				break;
			case R.id.more_app6_tv:
				url = "http://www.wxcitycq.com/city/";
				break;
			case R.id.more_app7_tv:
				url = "http://a.10086.cn/pams2/s/s.do?gId=100000021101377100001832373300002635986&c=172&j=l&lnpsk=%E6%89%8B%E6%9C%BA%E8%AF%81%E5%88%B8&lnpsid=3b95e92d0aac4d10bce970389077aed7&lnpspn=1&lnpsr=2&lnpst=0&lnpsgt=all&p=72&src=5600000004";
				break;
			case R.id.more_app8_tv:
				url = "http://m.shequ.10086.cn";
				break;
			case R.id.more_app9_tv:
				url = "http://f.10086.cn/wap2.jsp";
				break;
			case R.id.more_app10_tv:
				url = "http://wapmail.10086.cn";
				break;
			case R.id.more_app11_tv:
				url = "http://g.10086.cn";
				break;
			case R.id.more_app12_tv:
				url = "http://m.10086.cn";
				break;
			case R.id.more_app13_tv:
				url = "http://wap.cmread.com";
				break;
			case R.id.more_app14_tv:
				url = "http://wap.dm.10086.cn";
				break;
			case R.id.more_app15_tv:
				url = "http://wap.cmvideo.cn";
				break;
			case R.id.more_app16_tv:
				url = "http://dcd.10086.cn";
				break;

			default:
				break;
			}
			Bundle b = new Bundle();
			b.putCharSequence("title", title);
			b.putCharSequence("url", url);
			Intent intent = new Intent(AppSuggestActivity.this,
					WebViewActivity.class);
			intent.putExtras(b);
			startActivity(intent);
		}
	};
}
